var oLeftDate = document.querySelectorAll(
  ".Calendar_box_content_right_left_box3 p"
);
var oRightDate = document.querySelectorAll(
  ".Calendar_box_content_right_right_box3 p"
);
var oCalendar_year_month1 = document.querySelector(".Calendar_year_month1");
var oCalendar_year_month2 = document.querySelector(".Calendar_year_month2");
// 日期左输入框
var oCalendar_box_date1 = document.querySelector(".Calendar_box_date1");
var oCalendar_box_date1_img = document.querySelector(".Calendar_box_date1_img");
// 日期右输入框
var oCalendar_box_date2 = document.querySelector(".Calendar_box_date2");
var oCalendar_box_date2_img2 = document.querySelector(
  ".Calendar_box_date2_img"
);
//
var oCalendar_box_content = document.querySelector(".Calendar_box_content");

/* console.log(oLeftDate)
console.log(oRightDate)
console.log(oCalendar_year_month1.innerText)
console.log(oCalendar_year_month1.innerText)
console.log(oCalendar_box_date1)
console.log(oCalendar_box_date2) */
for (var i = 0; i < oLeftDate.length; i++) {
  oLeftDate[i].onclick = function () {
    var str1 = this.innerText;
    oCalendar_box_date1.value = oCalendar_year_month1.innerText + "-" + str1;
    oCalendar_box_content.style.display = "none";
  };
}
for (var i = 0; i < oRightDate.length; i++) {
  oRightDate[i].onclick = function () {
    var str2 = this.innerText;
    oCalendar_box_date2.value = oCalendar_year_month2.innerText + "-" + str2;
    oCalendar_box_content.style.display = "none";
  };
}

oCalendar_box_date1_img.addEventListener("click", openCalendarFn);
// flog = false;
function openCalendarFn() {
    if(oCalendar_box_date1.value == false){
        oCalendar_box_content.style.display = "block";
        oCalendar_box_date1_img.src = "../../images/tjy_img/content/content_calendar2.png";
    }else{
        oCalendar_box_date1.value = ''
        oCalendar_box_date1_img.src ="../../images/tjy_img/content/content_calendar.png";
    }
}
oCalendar_box_date2_img2.addEventListener("click", openCalendarFn2);
// flog2 = false;
function openCalendarFn2() {
    if(oCalendar_box_date2.value == false){
        oCalendar_box_content.style.display = "block";
        oCalendar_box_date2_img2.src = "../../images/tjy_img/content/content_calendar2.png";
    }else{
        oCalendar_box_date2.value = ''
        oCalendar_box_date2_img2.src ="../../images/tjy_img/content/content_calendar.png";
    }
}
